﻿@model Zor_Web.Models.Browse.V_AcceptanceBrowse
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>受理单浏览</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
    <!-- 日期选择器 -->
    <script src="~/Content/laydate/laydate.js"></script>
</head>
<body>
    <div class="layui-tab layui-tab-brief main-tab-container">
        <div class="mail-search col-sm-12 ct-padding">
            <button id="btnSearch" class="layui-btn  layui-btn-normal layui-btn-small"><span class="glyphicon glyphicon-search"></span>查询</button>
        </div>
        <div class="layui-tab-content" style="overflow-x:scroll;white-space:nowrap;">
            <table class="layui-table" lay-skin="line">
                <thead>
                    <tr>
                        <th hidden></th>
                        <th>街道办</th>
                        <th>社区</th>
                        <th>受理单号</th>
                        <th>受理状态</th>
                        <th>业主名称</th>
                        <th>业主电话</th>
                        <th>房屋面积</th>
                        <th>租金(元)</th>
                        <th>征收起日</th>
                        <th>征收止日</th>
                        <th>税金(元)</th>
                        <th>房屋属性</th>
                        <th>产权归属</th>
                        <th>房屋地址</th>
                    </tr>
                </thead>
                <tbody id="accordion">
                    @foreach (var item in Model.PageData)
                    {
                        <tr>
                            <td hidden>@item.Acceptance_Id</td>
                            <td>@item.StreetOffice</td>
                            <td>@item.Community</td>
                            <td>@item.Acceptance_TicketNumber</td>
                            <td>@item.AcceptanceState</td>
                            <td>@item.NatPer_Name</td>
                            <td>@item.NatPer_Phone</td>
                            <td>@item.Hs_Proportion</td>
                            <td>@(item.Lease_Rent * 0.01)</td>
                            <td>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxStartTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                            <td>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxEndTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                            <td>@(item.Acceptance_Tax * 0.01)</td>
                            <td>@item.Hsattribute</td>
                            <td>@item.HsNature</td>
                            <td>@item.Acceptance_Address</td>
                        </tr>
                    }
                </tbody>
            </table>
            <div class="row">
                <div class="col-sm-10">
                    @Html.Pager(Model.PageData, new PagerOptions { PageIndexParameterName = "index", ContainerTagName = "ul", PrevPageText = "上页", NextPageText = "下页", FirstPageText = "首页", LastPageText = "尾页", CssClass = "pagination", PagerItemsSeperator = "", CurrentPagerItemWrapperFormatString = "<li class=\"active\"><a href=\"#\">{0}</a></li>", PagerItemWrapperFormatString = "<li>{0}</li>" }, new { id = "", @class = "pagination" })
                </div>
                <div class="col-sm-2">
                    共 @Model.PageData.TotalItemCount 条记录，页 @Model.PageData.CurrentPageIndex/@Model.PageData.TotalPageCount
                </div>
            </div>
        </div>
    </div>
    <!-- 模态:查询 -->
    @using (Html.BeginForm("AcceptanceBrowse", "Browse", new RouteValueDictionary { { "Model", Model } }, FormMethod.Get))
    {   
    <div id="QueryModal" hidden data-backdrop="static">  
        <div class="layui-tab-content">
            <form class="form-horizontal m-t">
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">街道办：</label>
                    <div class="col-sm-4">
                        <select name="StreetOffice" class="form-control" id="StreetOffice"></select>
                    </div>
                    <label class="col-sm-2 layui-form-label">社区：</label>
                    <div class="col-sm-4">
                        <select class="form-control" name="Community" id="Community"></select>
                    </div>
                </div>    
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">受理单号：</label>
                    <div class="col-sm-4">
                        <input name="Acceptance_TicketNumber" class="form-control" type="text" value="@Model.Acceptance_TaxNumber">
                    </div>
                    <label class="col-sm-2 layui-form-label">受理状态：</label>
                    <div class="col-sm-4">
                        <select class="form-control" name="AcceptanceState">
                            <option value="" selected>全部</option>
                            <option value="已保存">已保存</option>
                            <option value="已提交">已提交</option>
                            <option value="已退回">已退回</option>
                            <option value="已评议">已评议</option>
                            <option value="已评定">已评定</option>
                            <option value="已审核">已审核</option>
                            <option value="已缴税">已缴税</option>
                            <option value="已出票">已出票</option>
                            <option value="已销号">已销号</option>
                            <option value="已汇总">已汇总</option>
                        </select>
                    </div>
                </div>
              
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">业主名称：</label>
                    <div class="col-sm-4">
                        <input name="NatPer_Name" type="text" class="form-control" value="@Model.NatPer_Name">
                    </div>
                    <label class="col-sm-2 layui-form-label">业主电话：</label>
                    <div class="col-sm-4">
                        <input name="NatPer_Phone" class="form-control" type="text" value="@Model.NatPer_Phone">
                    </div>
                </div>
               
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">征收起日：</label>
                    <div class="col-sm-4">
                        <input id="Acceptance_TaxStartTime" class="form-control layer-date laydate-icon" placeholder="开始日" onclick="laydate({ istime: false, format: 'YYYY-MM-DD' })" name="Acceptance_TaxStartTime" value="@Model.Acceptance_TaxStartTime">
                        @*<input class="laydate-icon form-control layer-date" id="Acceptance_TaxStartTime" placeholder="开始日" name="Acceptance_TaxStartTime" value="@Model.Acceptance_TaxStartTime">*@
                    </div>
                    <label class="col-sm-2 layui-form-label">征收止日：</label>
                    <div class="col-sm-4">
                        <input id="Acceptance_TaxEndTime" class="form-control layer-date laydate-icon" placeholder="截止日" onclick="laydate({ istime: false, format: 'YYYY-MM-DD' })" name="Acceptance_TaxEndTime" value="@Model.Acceptance_TaxEndTime">
                        @*<input class="laydate-icon form-control layer-date" id="Acceptance_TaxEndTime" placeholder="截止日" name="Acceptance_TaxEndTime " value="@Model.Acceptance_TaxEndTime">*@
                    </div>
                </div>
               
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">房屋属性：</label>
                    <div class="col-sm-4">
                        <select class="form-control" name="Hsattribute">
                            <option value="" selected>全部</option>
                            <option value="@Model.Hsattribute">非住宅</option>
                            <option value="@Model.Hsattribute">住宅</option>
                        </select>
                    </div>
                    <label class="col-sm-2 layui-form-label">产权归属：</label>
                    <div class="col-sm-4">
                        <select class="form-control" name="HsNature">
                            <option value="" selected>全部</option>
                            <option value="无">无</option>
                            <option value="民宅">民宅</option>
                            <option value="商用">商用</option>
                            <option value="商住两用">商住两用</option>
                        </select>
                    </div>
                </div>            
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">房屋地址：</label>
                    <div class="col-sm-4">
                        <input name="Acceptance_Address" class="form-control" type="text">
                    </div>
                </div>
            </form>
            <div class="box-footer">
                <button type="submit" id="btnQuery" class="btn btn-info pull-right">
                    <i class="fa fa-search"></i>查询
                </button>
            </div>
        </div>
     </div>
    }
</body>
</html>
<script>
    /**
     * 查询
   **/
    $(function () {
        $("#btnSearch").click(function () {
            GetStreetOffice();
            GetCommunity();
            LayerOpen('820px', '400px', '查询条件', $('#QueryModal'));//打开查询信息模态框                          
        })
    })

    /**
 * 日期选择器
 */
    laydate(
    { elem: "#Acceptance_TaxStartTime", event: "focus" },

    { elem: "#Acceptance_TaxEndTime", event: "focus" }
    );

    //获取当前社区名称
    function GetCommunity() {
        getAjax("/Browse/SelectCommunity", "", function (data) {
            accordionJson = eval("(" + data + ")");
            $("#Community").append("<option value='' >---     选择社区    ---</option>")
            $.each(accordionJson, function (i) {
                $("#Community").append("<option value='" + accordionJson[i].Dt_Name + "' >" + accordionJson[i].Dt_Name + "</option>");
            });
        });

    }
    //获取当前街道办
    function GetStreetOffice() {
        getAjax("/Browse/SelectStreetOffice", "", function (data) {
            accordionJson = eval("(" + data + ")");
            $.each(accordionJson, function (i) {
                $("#StreetOffice").append("<option value='" + accordionJson[i].Dt_Name + "' >" + accordionJson[i].Dt_Name + "</option>");
            });
        });
    }
</script>